package com.ciei.dpagm.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.ciei.dpagm.common.annotation.DefaultValue;
import com.ciei.dpagm.common.enums.RuleTypeEnum;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.Date;

/**
 * @author pp
 * @date 2023/03/10
 */
@TableName(value = "common_rule")
public class Rule {

    @TableId(type = IdType.AUTO)
    private Integer ruleId;
    private Integer ruleSetId;
    private Integer objectId;
    private RuleTypeEnum type;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String ruleName;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String ruleRemark;
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Integer prepositionRuleId;
    @TableField(fill = FieldFill.INSERT)
    @DefaultValue(intValue = 1)
    private Integer conditionalRelation;
    private String satisfy;
    private String notSatisfy;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    private Integer creatorId;
    private Integer updateUserId;
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer isDelete;

    public Rule() {
    }

    public Rule(Integer ruleId, Integer ruleSetId, Integer objectId, RuleTypeEnum type, String ruleName, String ruleRemark, Integer prepositionRuleId, Integer conditionalRelation, String satisfy, String notSatisfy, Date createTime, Date updateTime, Integer creatorId, Integer updateUserId, Integer isDelete) {
        this.ruleId = ruleId;
        this.ruleSetId = ruleSetId;
        this.objectId = objectId;
        this.type = type;
        this.ruleName = ruleName;
        this.ruleRemark = ruleRemark;
        this.prepositionRuleId = prepositionRuleId;
        this.conditionalRelation = conditionalRelation;
        this.satisfy = satisfy;
        this.notSatisfy = notSatisfy;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.creatorId = creatorId;
        this.updateUserId = updateUserId;
        this.isDelete = isDelete;
    }

    public Integer getRuleId() {
        return ruleId;
    }

    public void setRuleId(Integer ruleId) {
        this.ruleId = ruleId;
    }

    public Integer getRuleSetId() {
        return ruleSetId;
    }

    public void setRuleSetId(Integer ruleSetId) {
        this.ruleSetId = ruleSetId;
    }

    public Integer getObjectId() {
        return objectId;
    }

    public void setObjectId(Integer objectId) {
        this.objectId = objectId;
    }

    public RuleTypeEnum getType() {
        return type;
    }

    public void setType(RuleTypeEnum type) {
        this.type = type;
    }

    public String getRuleName() {
        return ruleName;
    }

    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }

    public String getRuleRemark() {
        return ruleRemark;
    }

    public void setRuleRemark(String ruleRemark) {
        this.ruleRemark = ruleRemark;
    }

    public Integer getPrepositionRuleId() {
        return prepositionRuleId;
    }

    public void setPrepositionRuleId(Integer prepositionRuleId) {
        this.prepositionRuleId = prepositionRuleId;
    }

    public Integer getConditionalRelation() {
        return conditionalRelation;
    }

    public void setConditionalRelation(Integer conditionalRelation) {
        this.conditionalRelation = conditionalRelation;
    }

    public String getSatisfy() {
        return satisfy;
    }

    public void setSatisfy(String satisfy) {
        this.satisfy = satisfy;
    }

    public String getNotSatisfy() {
        return notSatisfy;
    }

    public void setNotSatisfy(String notSatisfy) {
        this.notSatisfy = notSatisfy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(Integer creatorId) {
        this.creatorId = creatorId;
    }

    public Integer getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Integer updateUserId) {
        this.updateUserId = updateUserId;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
}
